package user_handler

import (
	"bird/internal/api/service/user_service"
	"bird/internal/pkg/cache"
	"bird/internal/pkg/core"
	"bird/internal/pkg/db"
	"bird/internal/pkg/message"

	"go.uber.org/zap"
)

var _ Handler = (*handler)(nil)

type Handler interface {
	i()

	// User 用户注册 && 注销
	// @Tags API.user
	// @Router /bird/api/user [POST]
	User() core.HandlerFunc

	// Token 获取 && 刷新
	// @Tags API.user
	// @Router /bird/api/token [POST]
	Token() core.HandlerFunc

	// VerifyCode 验证码接口
	// @Tags API.user
	// @Router /bird/api/verify_code [GET]
	VerifyCode() core.HandlerFunc

	// UserInfo 用户信息接口
	// @Tags API.user
	// @Router /bird/api/userinfo [GET]
	UserInfo() core.HandlerFunc
}

type handler struct {
	logger      *zap.Logger
	cache       cache.Repo
	sms         message.Repo
	userService user_service.Service
}

func New(logger *zap.Logger, db db.Repo, cache cache.Repo, sms message.Repo) Handler {
	return &handler{
		logger:      logger,
		cache:       cache,
		sms:         sms,
		userService: user_service.New(logger, db, cache, sms),
	}
}

func (h *handler) i() {}
